[mirrors]
http://nodejs.org/dist/v4.2.3/node-v4.2.3.tar.xz

[vars]
filesize=12768804
sha512=4b6196ee7a430a7834d30424728ddeea7e0fa44d3776f53072931337a8396f8ea3620880f5962eec469f585723d9036b1a1768f859b080f973c5568fc0c060db


[deps.host]
dynamic-toolchain
python

[build]
# Better fail here, than in the middle of the build!
if ! ($CC --version | grep -q -E '((4\.[8-9])|([5-9]\.[0-9]+))\.'); then
	echo "ERROR: GCC 4.8 or higher required!"
	exit 1
fi

patch -p1 < "$K"/nodejs-nameser_compat.h
patch -p1 < "$K"/nodejs-openssl_termios.h
patch -p1 < "$K"/nodejs-prefix.patch


CFLAGS="-D_GNU_SOURCE $optcflags" CXXFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" ./configure --prefix="$butch_prefix"

# the python configure script does not care about C(XX)FLAGS being passed
sed -i "s@cflags': \[\]@cflags': ['-D_GNU_SOURCE -D_BSD_SOURCE']@" config.gypi

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
